#include <iostream>
using namespace std;
int sum;
int fun(int x){
	int sum=0;
	int a[10]={6,2,5,5,4,5,6,3,7,6};
	int y=x;
	if(y==0) sum+=6;
				else{
				while(y!=0){
					sum+=a[y%10];
					y=y/10;
				}
				}
	return sum;			
	
}
int main() {
	int m,r,i,j,k;
	cin>>m;
	r=m-4;
	int total=0;
	
	for(i=0;i<1111;i++){
		for(j=0;j<1111;j++){
			k=i+j;
			if(fun(i)+fun(j)+fun(k)==r){
				total++;
				cout<<i<<"+"<<j<<"="<<k<<endl;
			} 
			
		}
	}
	cout<<total<<endl;
     return 0;
}





